-- Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
--
-- this file licensed under the Mulan PSL v2.
-- You can use this software according to the terms and conditions of the Mulan PSL v2.
-- You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2
--
-- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
-- PURPOSE.
-- See the Mulan PSL v2 for more details.
--
-- Author: auto generate
-- Create: 2025-9-3
-- Description: DO NOT EDIT; Code generated by "message.lua.mako"
local validate = require 'mc.validate'
local utils = require 'mc.utils'
local mdb = require 'mc.mdb'

local Community = {}

---@class Community.WelcometoOpenUBMC
---@field WelcometoOpenUBMC string
local TWelcometoOpenUBMC = {}
TWelcometoOpenUBMC.__index = TWelcometoOpenUBMC
TWelcometoOpenUBMC.group = {}

local function TWelcometoOpenUBMC_from_obj(obj)
    return setmetatable(obj, TWelcometoOpenUBMC)
end

function TWelcometoOpenUBMC.new(WelcometoOpenUBMC)
    return TWelcometoOpenUBMC_from_obj({WelcometoOpenUBMC = WelcometoOpenUBMC})
end
---@param obj Community.WelcometoOpenUBMC
function TWelcometoOpenUBMC:init_from_obj(obj)
    self.WelcometoOpenUBMC = obj.WelcometoOpenUBMC
end

function TWelcometoOpenUBMC:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TWelcometoOpenUBMC.group)
end

TWelcometoOpenUBMC.from_obj = TWelcometoOpenUBMC_from_obj

TWelcometoOpenUBMC.proto_property = {'WelcometoOpenUBMC'}

TWelcometoOpenUBMC.default = {''}

TWelcometoOpenUBMC.struct = {{name = 'WelcometoOpenUBMC', is_array = false, struct = nil}}

function TWelcometoOpenUBMC:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'WelcometoOpenUBMC', self.WelcometoOpenUBMC, 'string', false, errs, need_convert)

    TWelcometoOpenUBMC:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TWelcometoOpenUBMC.proto_property, errs, need_convert)
    return self
end

function TWelcometoOpenUBMC:unpack(_)
    return self.WelcometoOpenUBMC
end

Community.WelcometoOpenUBMC = TWelcometoOpenUBMC

Community.interface = mdb.register_interface('bmc.kepler.OpenUBMC.Community',
    {WelcometoOpenUBMC = {'s', nil, false, nil, false}}, {}, {})

return Community
